package com.ruoyi.worklog.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

import static com.ruoyi.common.constant.WorklogConstants.DayLog;
import static com.ruoyi.common.constant.WorklogConstants.NotApproved;

/**
 * @Author cw
 * @Date 2022/7/22 - 07 - 22
 * @Description com.ruoyi.worklog.domain
 */
public class WlWorkLog {
    private int id;
    @NotNull(message="记录内容不能为空")
    private String content;

    private byte log_type=DayLog;//报告类型，日报-1，月报-2
    @Max(24)
    @Min(0)
    private byte work_time;
    private byte approval_status=NotApproved;// 审批状态
    private String image_url;
    private String file_url;
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date created_at;
    private Date updated_at;
    private SysUser staff; // 关联到员工外键
    private List<WlProject> projects; // 关联到项目

    @Override
    public String toString() {
        return "WlWorkLog{" +
                "id=" + id +
                ", content='" + content + '\'' +
                ", log_type=" + log_type +
                ", work_time=" + work_time +
                ", approval_status=" + approval_status +
                ", image_url='" + image_url + '\'' +
                ", file_url='" + file_url + '\'' +
                ", created_at=" + created_at +
                ", updated_at=" + updated_at +
                ", staff=" + staff +
                ", projects=" + projects +
                '}';
    }

    public WlWorkLog(){

    }
    public byte getLog_type() {
        return log_type;
    }

    public void setLog_type(byte log_type) {
        this.log_type = log_type;
    }
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public short getWork_time() {
        return work_time;
    }

    public void setWork_time(byte work_time) {
        this.work_time = work_time;
    }

    public byte getApproval_status() {
        return approval_status;
    }

    public void setApproval_status(byte approval_status) {
        this.approval_status = approval_status;
    }

    public String getImage_url() {
        return image_url;
    }

    public void setImage_url(String image_url) {
        this.image_url = image_url;
    }

    public String getFile_url() {
        return file_url;
    }

    public void setFile_url(String file_url) {
        this.file_url = file_url;
    }

    public Date getCreated_at() {
        return created_at;
    }

    public void setCreated_at(Date created_at) {
        this.created_at = created_at;
    }

    public Date getUpdated_at() {
        return updated_at;
    }

    public void setUpdated_at(Date updated_at) {
        this.updated_at = updated_at;
    }

    public SysUser getStaff() {
        return staff;
    }

    public void setStaff(SysUser staff) {
        this.staff = staff;
    }

    public List<WlProject> getProjects() {
        return projects;
    }

    public void setProjects(List<WlProject> projects) {
        this.projects = projects;
    }
}
